<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>药品审核查看(生产企业端)</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %> 
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">

    <section class="content-header">
         <h1>药品审核查看</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">招标采购管理</a></li>
            <li class="active"><a href="#">投标药品信息管理</a></li>
            <li class="active"><a href="#">药品审核查看</a></li>
        </ol>
    </section>
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                    <div class="form-group form-group-xs">
                     <label>药品编码：</label>
                        <input class="form-control" id="drugcode" name="drugcode" type="text" placeholder="药品编码" />
                    </div>
                     <div class="form-group form-group-xs">
                        <label>通用名：</label>
                        <input class="form-control" id="qualityspecName" name="qualityspecName" type="text" placeholder="通用名" />
                    </div>
                     
                   <div class="form-group form-group-xs">
                        <label for="searchPharName">审核状态：</label>
                         <select class="form-control" style="width:120px" id="auditStatus">
                            <option value="" >-- 请选择 --</option>
                            <option value="0">未审核</option>
                            <option value="1">审核通过</option>
                            <option value="2">审核不通过</option>
                        </select>
                    </div>
                   
                    <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm"> 查&nbsp;询</button>
                </div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        <div class=" box box-warning bottongroup">
            <a href="${ctx}/prodDrug/toDrugProjectListDeclareSee.html" class="btn btn-default btn-sm">返&nbsp;&nbsp;回</a>
        </div>

    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp" %> 
    <script type="text/javascript">
        
        $(function () {
            
            $("#gridlist").jqGrid({
                url: "${ctx}/prodDrug/getDrugAuditResultList.html?projId=${projId}",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                //shrinkToFit:false,
                height: 270,
                colNames: [ 'projId', 'prodId','qualityspecId','药品编码',  '通用名', '剂型', '规格', '转换系数', '单位','材质', '审核状态', '审核时间', '审核备注'],
                colModel: [
                    { name: 'projId', width: 120 ,hidden:true, align:"center",sortable: false},
                    { name: 'prodId', width: 120 ,hidden:true, align:"center",sortable: false},
                    { name: 'qualityspecId',hidden:true, width: 120 , align:"center",sortable: false},
                    { name: 'drugCode', width: 100 , align:"center",sortable: false},
                    { name: 'qualityspecName', width: 140 , align:"left" ,sortable: false},
                    { name: 'form', width: 80 , align:"center" ,sortable: false},
                    { name: 'spec', width: 80 , align:"left" ,sortable: false},
                    { name: 'factor', width: 80 , align:"center" ,sortable: false},
                    { name: 'unit', width: 40 , align:"center" ,sortable: false},
                    { name: 'materialName', width: 80 , align:"center" ,sortable: false},
                    { name: 'auditStatus', width: 80 , align:"center",sortable: false,
                        formatter : function(val, opts, rowdata) {
                            var str = "";
                            if(rowdata.auditStatus == 0){
                                str += "未审核";
                            }
                            if(rowdata.auditStatus == 1){
                                str += "审核通过";
                            }
                            if(rowdata.auditStatus == 2){
                                str += "审核不通过";
                            }
                            return str;
                            }
                    },
                    { name: 'auditDatetime', width: 140 , align:"center",sortable: false },
                    { name: 'auditRemark', width: 160 , align:"left",sortable: false }
                ],
                rowNum: 20,
                rowList: [10,20,50,100],
                rownumbers: true,
                pager: "#gridpage",
                multiselect: false, 
                viewrecords: true,
                caption: "药审列表",
                jsonReader: {
                    repeatitems: false,
                    id: "prodId"
                },
                loadComplete: function (result) { //完成服务器请求后，回调函数
                	if(result.conditions.tag=='1'){
                           $(".box-warning").html("")
	             	}else{
	                       $(".box-warning").html("<label  onclick='submitProdDrugList()' class='btn btn-default btn-sm'>申&nbsp;&nbsp;报</label> <a href='${ctx}/prodDrug/toDrugProjectListDeclare.html' class='btn btn-default btn-sm'>返&nbsp;&nbsp;回</a>")
	             	}
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");  
            
        });
        

        //查询
        function gridSerch() {
            var drugcode = $("#drugcode").val();
            var qualityspecName = $("#qualityspecName").val();
            var auditStatus = $("#auditStatus").val();
            $("#gridlist").jqGrid('setGridParam',{  
                datatype:'json',
                postData:{"drugCode":drugcode,
                        "qualityspecName":qualityspecName,
                        "auditStatus":auditStatus}
            }).trigger("reloadGrid"); //重新载入  
        }
        
        
        
        
        //生产企业弹窗
        function showCompInfo(prodCompId) {
            $.HN.dialog.open({
                "id": "showCompInfo", 
                "title": "生产企业信息", 
                "url": "${ctx}/stdCompinfo/toStdCompinfoDetail.html?compId="+prodCompId,
                "data": {}, 
                "width": 800, 
                "height": 400, 
                "closefunc":function() {
                    
                }
            });
        }
        
        
 
    </script>
</body>
</html>